Skip to content

[Mirror] Fix Windows desktop OS build version reporting#5

Open
bmehta001 wants to merge 10 commits into
mainfrom
bhamehta/fix-windows-os-version
Open

[Mirror] Fix Windows desktop OS build version reporting#5
bmehta001 wants to merge 10 commits into
mainfrom
bhamehta/fix-windows-os-version

Conversation

@bmehta001
Copy link
Copy Markdown
Owner

Summary

  • Stop using stale BuildLabEx to populate Windows desktop OS full version.
  • Use servicing-aware CurrentBuildNumber/CurrentBuild plus UBR, falling back to RtlGetVersion() build when registry build values are unavailable.
  • Add a Windows PAL unit test for the formatted OS full version with and without UBR.

Fixes microsoft#1407

bmehta001 and others added 4 commits May 18, 2026 17:29
Use servicing-aware registry values so desktop telemetry reports the current Windows build instead of stale BuildLabEx data after OS updates.

Files changed:

- lib/pal/desktop/WindowsDesktopSystemInformationImpl.cpp

- tests/unittests/PalTests.cpp

Fixes microsoft#1407

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refactor the Windows OS full-version composition into a testable helper so registry and Rtl build source precedence can be covered without depending on the host machine state.

The new PAL tests cover CurrentBuildNumber precedence, CurrentBuild fallback, Rtl build fallback, and missing UBR formatting so future key or fallback regressions are caught before merge.

Files changed:

- lib/pal/desktop/WindowsDesktopSystemInformationImpl.cpp

- tests/unittests/PalTests.cpp

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a deterministic PAL test proving that UBR value 0 is still included when the source reports it as present. This keeps zero-value handling separate from the missing-UBR fallback.

Files changed:

- tests/unittests/PalTests.cpp

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@trancified trancified left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

bmehta001 and others added 6 commits May 22, 2026 01:44
* Update vendored zlib to 1.3.2

Refresh vendored zlib sources, headers, documentation, and minizip files to upstream v1.3.2 so the SDK tracks the current supported zlib release.

Preserve the SDK's symbol-prefix shim and legacy Windows project wiring, and update the zlib CMake shim so out-of-source builds no longer mutate zconf.h or define Windows macros on non-Windows hosts.

Files changed:

- cgmanifest.json

- zlib core sources, headers, docs, and minizip support files

- zlib/names.h and zlib/CMakeLists.txt repo-specific shims

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move zlib MSBuild projects outside vendored tree

Keep the vendored zlib folder closer to the upstream 1.3.2 layout while preserving the legacy MSBuild project used by the Windows solution.

Files changed:

- Move vc14 zlib Visual Studio projects to third_party/Solutions/zlib/vc14

- Update solution, sample, and test ProjectReference paths

- Remove unused vc9/vc10/vc11 zlib project directories

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove stale MSBuild project entries

Clean project and filter wiring that points at removed or generated files so Visual Studio metadata matches the files carried in the repo.

Files changed:

- Solutions/Clienttelemetry/Clienttelemetry.vcxitems

- examples/cpp project and filter files

- lib/pal and lib/tracing shared item files

- tests/googletest filter metadata

- third_party/Solutions/zlib/vc14/zlibvc.vcxproj

- tools/ports/mstelemetry/v142-build.patch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Keep UWP package signing comments for documentation

The commented PackageCertificateKeyFile and PackageCertificateThumbprint
lines document how to enable Appx package signing if a developer provides
a TestApp.pfx. Restore them so the sample retains its re-enablement
instructions; only the unconditional None Include for TestApp.pfx
(which referenced a missing file) needed to go.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Restore conditional UTC filter entries in lib/pal

The matching desktop.vcxitems and universal.vcxitems still include the
UTC module sources via Condition="Exists(...)". Removing the parallel
entries from the .filters files would orphan those sources in Visual
Studio Solution Explorer when the lib/modules submodule is present.
Restore the conditional ItemGroups so solution organization stays
correct when the optional module exists.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Match SignalsFuncTests filter path to vcxproj entry

FuncTests.vcxproj uses $(ProjectDir)..\..\lib\modules\signals\tests\functests\SignalsFuncTests.cpp while the parallel filter entry was missing the $(ProjectDir) prefix, so when the signals submodule is present Visual Studio cannot associate the source file with the Source Files filter. Align the filter Include with the project Include.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per Windows-team guidance on issue microsoft#1407: the RtlGetVersion() API is the
authoritative source for the running OS build number, and the registry
CurrentBuildNumber / CurrentBuild values are only useful for offline
reads of another Windows installation. For the running OS the API and
registry are always in sync, so prefer the API. UBR is registry-only and
is always safe to combine with the kernel-provided build number.

Drop the registry CurrentBuildNumber / CurrentBuild precedence chain and
the now-unused getCurrentVersionStringValue helper. Format the OS full
version directly from rtlOsvi.dwBuildNumber plus the optional UBR.

Update PalTests to cover the simplified formatter (UBR present, UBR
missing, zero UBR present), replacing the obsolete source-precedence
tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per review feedback: the Windows team confirmed the registry build
values "should always be in sync" with RtlGetVersion, which means the
registry is a perfectly valid fallback when the API path can't be
reached (e.g., GetProcAddress for RtlGetVersion returning null in a
sandboxed image). Better to emit a correct value from the registry than
an empty ext.os.ver.

Restore the registry build-number lookup as a fallback chain after
RtlGetVersion:

  rtlOsvi.dwBuildNumber  (preferred, kernel-authoritative)
    -> registry CurrentBuildNumber
    -> registry CurrentBuild
    -> empty osFullVersion

Also fall back to registry CurrentMajorVersionNumber /
CurrentMinorVersionNumber when RtlGetVersion is unavailable, so callers
still get a usable osMajorVersion. UBR is registry-only and is always
safe to combine with whichever build source succeeds.

Update PalTests to cover the new precedence (RTL preferred over
registry, CurrentBuildNumber fallback, CurrentBuild fallback, empty
result when nothing is available) plus the formatter UBR cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] 1DS reports OS version of the base OS at RTM and does not reflect any servicing updates

2 participants